<html>
    <head>
        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript" src="js/qrcode.min.js"></script>
    </head>
    <body>
        <div id="qrcode"></div>
        <input type="hidden" id="qrValue" value="http://www.sjhaishi.com/#/page19?ShipID=">
        <script type="text/javascript">
            // 从Query String获取某个值
            var getQueryStringByKey = function (key) {
                var queryString = window.location.search;
                var queryStringArray = queryString.split('&');
                var currentQueryString = '';
                for (var i = 0; i < queryStringArray.length; i++) {
                    var temp = queryStringArray[i];
                    if (temp.indexOf(key) >= 0) {
                    currentQueryString = queryStringArray[i];
                    break;
                    }
                }
                var currentQueryStringArray = currentQueryString.split('=');
                if (currentQueryStringArray.length > 1) {
                    return currentQueryStringArray[1];
                } else {
                    return '';
                }
            };
            
            $(document).ready(function(){
                var qrvalue = '';
                qrvalue = qrvalue + getQueryStringByKey('ID');
                new QRCode(document.getElementById("qrcode"), qrvalue);
            });
            
        </script>
    </body>
</html>